package io;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class PWDemo02 {
    public static void main(String[] args) throws Exception{
        FileOutputStream fos = new FileOutputStream("pw2.txt", true);
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw,true);

        Scanner scan = new Scanner(System.in);
        while (true){
            String line = scan.nextLine();
            if ("exit".equalsIgnoreCase(line)){
                break;
            }
            pw.println(line);
        }
        System.out.println("88");
        pw.close();
    }
}
